package cfdt.ldl.file.api.feign;

import cfdt.ldl.file.api.request.DownloadFileRequest;
import cfdt.ldl.file.api.request.UploadFileRequest;
import cfdt.ldl.file.api.response.DownloadFileResponse;
import cfdt.ldl.file.api.response.UploadFileResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

import cfdt.common.vo.ObjectBaseResponse;
import cfdt.ldl.file.api.feign.fallback.FileFallBack;

/**
 * 文件中心API
 *
 * <pre>
 * Modify Information:
 * Author       Date          Description
 * ============ ============= ============================
 * wangxiao      2021年8月10日下午2:13:00      创建feign类
 *
 * </pre>
 */
@FeignClient(value = "ldl-file", fallbackFactory = FileFallBack.class, path = "ldl-file")
public interface FileFeign {

    /**
     * 根据ID获取文件
     * 
     * @param request
     * @return
     */
    @GetMapping("/file/downloadFile")
    ObjectBaseResponse<DownloadFileResponse> downloadFile(@RequestBody DownloadFileRequest request);

    /**
     * 上传文件获得ID
     * 
     * @param request
     * @return
     */
    @GetMapping("/file/uploadFile")
    ObjectBaseResponse<UploadFileResponse> uploadFile(@RequestBody UploadFileRequest request);

}
